]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginScreen: reset greeter when coming back to login screen
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 8 Mar 2014 00:35:02 +0000 (19:35 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 25 Mar 2014 14:41:12 +0000 (10:41 -0400)
When a user logs in to a wayland session, we keep the login screen
running on the X server with the login screen running in a deactivated mode.

This commit makes sure it get reactivated when the user comes back to
the VT (from user switching, logout or just ctrl-alt-f1).

https://bugzilla.gnome.org/show_bug.cgi?id=726989

js/gdm/loginDialog.js
js/misc/loginManager.js

index 6e3cb97e3241162a9bbd7e5959c3413261a6f615..68b4ee18982a79f1106d544b642e54bed3651372 100644 (file)
@@ -36,6 +36,7 @@ const BoxPointer = imports.ui.boxpointer;
 const CtrlAltTab = imports.ui.ctrlAltTab;
 const GdmUtil = imports.gdm.util;
 const Layout = imports.ui.layout;
+const LoginManager = imports.misc.loginManager;
 const Main = imports.ui.main;
 const PopupMenu = imports.ui.popupMenu;
 const Realmd = imports.gdm.realmd;
@@ -472,6 +473,8 @@ const LoginDialog = new Lang.Class({
         this._disableUserList = undefined;
         this._userListLoaded = false;
 
+        LoginManager.getLoginManager().getCurrentSessionProxy(Lang.bind(this, this._gotGreeterSessionProxy));
+
         // If the user list is enabled, it should take key focus; make sure the
         // screen shield is initialized first to prevent it from stealing the
         // focus later
@@ -635,6 +638,36 @@ const LoginDialog = new Lang.Class({
         this._showPrompt();
     },
 
+    _loginScreenSessionActivated: function() {
+        if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFICATION_SUCCEEDED)
+            return;
+
+        Tweener.addTween(this.actor,
+                         { opacity: 255,
+                           time: _FADE_ANIMATION_TIME,
+                           transition: 'easeOutQuad',
+                           onUpdate: function() {
+                               let children = Main.layoutManager.uiGroup.get_children();
+
+                               for (let i = 0; i < children.length; i++) {
+                                   if (children[i] != Main.layoutManager.screenShieldGroup)
+                                       children[i].opacity = this.actor.opacity;
+                               }
+                           },
+                           onUpdateScope: this,
+                           onComplete: function() {
+                               this._authPrompt.reset();
+                           },
+                           onCompleteScope: this });
+    },
+
+    _gotGreeterSessionProxy: function(proxy) {
+        proxy.connect('g-properties-changed', Lang.bind(this, function() {
+            if (proxy.Active)
+                this._loginScreenSessionActivated();
+        }));
+    },
+
     _startSession: function(serviceName) {
         Tweener.addTween(this.actor,
                          { opacity: 0,
index ae87a55090a97e4d3f42be7e581744d8bfb833c7..fac56774bd30ab683aea4d13893c62ea6fd9620b 100644 (file)
@@ -39,6 +39,7 @@ const SystemdLoginSessionIface = '<node> \
 <interface name="org.freedesktop.login1.Session"> \
 <signal name="Lock" /> \
 <signal name="Unlock" /> \
+<property name="Active" type="b" access="read" /> \
 </interface> \
 </node>';